package cn.itlaobing.Util;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author mifei
 * @create 2018年04月11日
 **/
public class MyBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {

        if (beanName.indexOf("accountServiceImpl")>=0){
            System.out.println("MyBeanPostProcessor before->"+beanName);
        }
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if (beanName.indexOf("accountServiceImpl")>=0){
            System.out.println("MyBeanPostProcessor after -> "+beanName);
        }
        return bean;
    }

}
